//package mylab.starters.mybatis.config;
//
//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import mylab.starters.mybatis.interceptor.OrderlyInterceptor;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.AutoConfigureAfter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.List;
//import java.util.stream.Collectors;
//
//@Slf4j
//@MapperScan("**.mapper.**")
//@RequiredArgsConstructor(onConstructor_ = @Autowired)
//@Configuration(proxyBeanMethods = false)
//@AutoConfigureAfter(MPAutoConfiguration.class)
//public class DbPluginAutoConfiguration {
//    private final List<OrderlyInterceptor> innerPlugins;
//
//    @Bean
//    public MybatisPlusInterceptor mybatisPlusInterceptor() {
//        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
//        innerPlugins.stream().sorted().collect(Collectors.toList()).forEach(interceptor::addInnerInterceptor);
//        return interceptor;
//    }
//
//}
